<?php
$err = isset($_GET['error']) ? $_GET['error'] : null ;
mysql_query("SET CHARACTER SET utf8 ");

require'../clases/sesiones.php';
$objses = new Sesion();
$objses->iniciar();

$user = isset($_SESSION['user']) ? $_SESSION['user'] : null ;
$profile = $_SESSION['idprofile'];
$habilitado = $_SESSION['habilitado'];
if($user == ''){
    header('Location: ../index.php?error=2');
}elseif($habilitado == false){
	header('Location: ../index.php?error=5');
}
?>
<!DOCTYPE html>
<html lang = "es">
    <head>
        <title>Intranet Renacer</title>
        <meta charset="UTF-8">
        <link rel="stylesheet" type="text/css" href="../css/intranet.css">
        <script src="../js/jquery.min.js"></script>
		<script src = "../js/mis-contactos.js"></script>
    </head>
    <body>
        <header id="header">
	        <hgroup>
				<h1 class="site_title"><a href="index.html">Intranet Renacer</a></h1>
			</hgroup>
                <?php 
                if($err==1){
                    echo '<div class="error">Usted no tiene los privilegios para ingresar a la URL solicitada, Acceso Denegado</div>';
                }
             ?>
  		</header>
  		<section id="secondary_bar">
			<div class="user">
				<p><?php echo $_SESSION['name'] . " " . $_SESSION['apep'];?> (<a style="text-decoration: underline; color: blue;" href="log_out.php">Salir</a>)</p>
				<!-- <a class="logout_user" href="#" title="Logout">Logout</a> -->
			</div>
			</section>
	  		<aside id="sidebar">
	            <?php
	            		require'../clases/config.php';
						require'../clases/usuarios.php';
						require'../clases/acciones.php';
						$objCone = new Coneccion();
						$objUsuario = new Usuario();
						                
						$objCone->conectar_bd();
	                	$objUsuario->smenu();
	            ?>
	        </aside>
	        <section id = "principal">
			</section>
    </body>
</html>